package com.ymatou.iapi.userservice.service;

import org.json.JSONObject;

import com.ymatou.iapi.userservice.parameter.resp.QueryLoginSafeLogResp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;

/**
 * 修改登入账户信息Call FreeMaker Template自动生成代码
 */
public class GetLoginSafeStatusRequestDtoCall extends YmatouBaseCall {
	private static String opurl = "json/reply/GetLoginSafeStatusRequestDto";

	public GetLoginSafeStatusRequestDtoCall() {
		super(EnvSetup.getSystemUrl("userservice_iapi"), opurl, "GET", "PARAM");
	}

//	@Override
//	public void addDefHeader() {
//		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
//		client.addHeader("Content-Type", "application/json; charset=UTF-8");
//	}

	/**
	 * 获取Success
	 * 
	 * @return
	 */
	public boolean getSuccess() {
		boolean Success = false;
		try {
			Success = new JSONObject(getReturnData()).getBoolean("Success");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Success;
	}

	/**
	 * 获取ResponseCode
	 * 
	 * @return
	 */
	public String getResponseCode() {
		String ResponseCode = null;
		try {
			ResponseCode = new JSONObject(getReturnData()).getString("ResponseCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ResponseCode;
	}

	/**
	 * 获取LastErrorMessage
	 * 
	 * @return
	 */
	public String getLastErrorMessage() {
		String LastErrorMessage = null;
		try {
			LastErrorMessage = new JSONObject(getReturnData()).getString("LastErrorMessage");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return LastErrorMessage;
	}
	public QueryLoginSafeLogResp getQueryLoginSafeLogResp() {
		QueryLoginSafeLogResp queryLoginSafeLogResp = new QueryLoginSafeLogResp();
		try {
			String data=new JSONObject(getReturnData()).getString("Result");
			queryLoginSafeLogResp = (QueryLoginSafeLogResp)FormatUtil.GSONToObject(data, QueryLoginSafeLogResp.class);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return queryLoginSafeLogResp;
	}
}